home *** CD-ROM | disk | FTP | other *** search
- /* FileOp.xdme */
-
- if ~show("L","rexxreqtools.library") then
- if ~addlib("rexxreqtools.library", 0, -30) then exit
-
- Parse Arg HAIL .
-
- tagstr = "rt_reqpos=reqpos_centerscr rtfi_flags=freqf_patgad"
- select
- when HAIL = "Saveas" then do
- oktext = "_Save"
- hailstr = "Save File As ..."
- tagstr = tagstr || "|freqf_save"
- end
- when HAIL = "Replace" then do
- oktext = "_Load"
- hailstr = "Replace File With ..."
- end
- when HAIL = "Decrypt" then do
- oktext = "_Load"
- hailstr = "Select File to Decrypt ..."
- end
- otherwise exit
- end
-
- options results
- address 'XDME.1'
- 'rxresult $path'
- P = result
- 'rxresult $fname'
- N = result
- 'rxresult $filename'
- OF = result
-
- F = rtfilerequest(P,N,hailstr,oktext,tagstr)
- if rtresult = 0 then exit
-
- F0 = '(' || F || ')'
- F1 = '"' || F || '"'
-
- if HAIL = "Decrypt" then do
- xcom = "execute (copy" F1 "t:temp)"
- xcom
- password = rtgetstring(,,"Please Enter Password")
- xcom = 'execute (xpack t:temp password "' || password || '")'
- xcom
- if OF ~= F then do
- newwindow
- end
- newfile 't:temp'
- chfilename F0
- xcom = 'settvar password' password
- xcom
- call Mode(F)
- end
- else do
- C = 'menudel Window (' || N || ')'
- C
-
- if HAIL = "Replace" then do
- newfile F0
- call Mode(F)
- end
- else do /* HAIL = "Saveas" */
- chfilename F0
- call Save()
- end
- end
-
- PL = lastpos("/", F)
- if PL = 0 then PL = lastpos(":", F)
- N = delstr(F, 1, PL)
-
- C = 'menuadd Window (' || N || ') (select (window=' || N || '))'
- C
-